﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace MedicService.Server.Utils {
    public class Utils {
        public static string Md5(string input) {
            var x = new System.Security.Cryptography.MD5CryptoServiceProvider();
            byte[] bs = System.Text.Encoding.UTF8.GetBytes(input);
            bs = x.ComputeHash(bs);
            var s = new System.Text.StringBuilder();
            foreach (byte b in bs) {
                s.Append(b.ToString("x2").ToLower());
            }
            string result = s.ToString();
            return result;
        }
    }
}